---@class Table_StoryGuideItem
local Table_StoryGuideItem = class("Table_StoryGuideItem");

function Table_StoryGuideItem:ctor()
    self.Id = 0;    --唯一ID
    self.StoryContentId = 0;    --剧情对话内容ID
    self.StoryRes = "";    --剧情人物资源路径
    self.StoryImgName = "";    --剧情人物资源名称
    self.NextStoryId = 0;    --后续剧情ID
    self.SoundId = 0;    --音效ID
end

function Table_StoryGuideItem:Load(reader)
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Id = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.StoryContentId = tonumber(self.temp); end
    self.StoryRes = reader:ReadString();
    self.StoryImgName = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.NextStoryId = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.SoundId = tonumber(self.temp); end
    self.temp = nil;
end

---@class Table_StoryGuideMgr : IDataMgr
local Table_StoryGuideMgr = class("Table_StoryGuideMgr", IDataMgr);

function Table_StoryGuideMgr:FileName()
    return "Txt/StoryGuide.txt";
end

---@return Table_StoryGuideItem
function Table_StoryGuideMgr:GetItemById(id)
    return self.super:GetItemById(id)
end

---@return Table_StoryGuideItem
function Table_StoryGuideMgr:GetItemByIdx(idx)
    return self.super:GetItemByIdx(idx)
end

function Table_StoryGuideMgr:Load(reader)
    local item = Table_StoryGuideItem.new();
    item:Load(reader);
    self.mItemDic[item.Id] = self.mDataCount;
    table.insert(self.mItemList, item);
end

return Table_StoryGuideMgr;